# the minimum version of CMake.
#cmake_minimum_required(VERSION 3.5.0)
#project(myNpmLib)
#
#set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
#
#if(DEFINED PACKAGE_FIND_FILE)
#    include(${PACKAGE_FIND_FILE})
#endif()
#
#include_directories(${NATIVERENDER_ROOT_PATH}
#                    ${NATIVERENDER_ROOT_PATH}/include)
#
#add_library(mavlink SHARED napi_init.cpp types/mavlink.h mavlink_wrapper.cpp mavlink_wrapper.h)
#target_link_libraries(mavlink PUBLIC libace_napi.z.so)

# ------
cmake_minimum_required(VERSION 3.5.0)

project(mavlink_native)

if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

add_library(mavlink SHARED napi_init.cpp mavlink_wrapper.cpp)

# Include mavlink headers
target_include_directories(mavlink PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/types
    ${CMAKE_CURRENT_SOURCE_DIR}/types/common
)

# For HarmonyOS / OpenHarmony
if (DEFINED OHOS_ARCH)
    target_compile_definitions(mavlink PUBLIC __MUSL__)
endif()

target_link_libraries(mavlink PUBLIC libace_napi.z.so)